package vn.com.vega.music.view.adapter;

import vn.com.vega.chacha.v2.fragment.ListAlbumFeatureFragment;
import vn.com.vega.chacha.v2.fragment.ListChartFeatureFragment;
import vn.com.vega.chacha.v2.fragment.ListNewsFeatureFragment;
import vn.com.vega.chacha.v2.fragment.ListPlaylistFeatureFragment;
import vn.com.vega.chacha.v2.fragment.ListFeatureSongFragment;
import vn.com.vega.chacha.v2.fragment.ListVideoFeatureFragment;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class MainScreenListsAdapter extends FragmentPagerAdapter {
	public static final int INDEX_LIST_FEATURE_SONG = 0;
	public static final int INDEX_LIST_FEATURE_VIDEO = 1;
	public static final int INDEX_LIST_FEATURE_ALBUM = 2;
	public static final int INDEX_LIST_FEATURE_PLAYLIST = 3;
	public static final int INDEX_LIST_FEATURE_CHART = 4;
	public static final int INDEX_LIST_FEATURE_NEWS = 5;
	
	public static final int TOTAL_VIEW = 6;

	public MainScreenListsAdapter(FragmentManager fm) {
		super(fm);
		// TODO Auto-generated constructor stub
	}

	@Override
	public Fragment getItem(int position) {
		// TODO Auto-generated method stub
		Fragment f = new Fragment();
		switch (position) {
		case INDEX_LIST_FEATURE_SONG:
			f = ListFeatureSongFragment.newInstance();
			break;
		case INDEX_LIST_FEATURE_VIDEO:
			f = ListVideoFeatureFragment.newInstance();
			break;
		case INDEX_LIST_FEATURE_ALBUM:
			f = ListAlbumFeatureFragment.newInstance();
			break;
		case INDEX_LIST_FEATURE_PLAYLIST:
			f = ListPlaylistFeatureFragment.newInstance();
			break;
		case INDEX_LIST_FEATURE_NEWS:
			f = ListNewsFeatureFragment.newInstance();
			break;
		case INDEX_LIST_FEATURE_CHART:
			f = ListChartFeatureFragment.newInstance();
			break;
		default:
			break;
		}
		return f;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return TOTAL_VIEW;
	}
}
